<!--
 * @Author: kiwi
 * @Date: 2025-05-30 13:44:59
 * @LastEditTime: 2025-06-05 10:59:09
 * @LastEditors: kiwi
 * @FilePath: \kouhan-h5\src\App.vue
 * @Description:
-->
<template>
  <div id="app">
    <router-view />
    <theme-picker />
  </div>
</template>

<script>
import ThemePicker from "@/components/ThemePicker"

export default {
  name: "App",
  components: { ThemePicker },
  metaInfo() {
    return {
      title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
      titleTemplate: title => {
        return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
      }
    }
  },
  mounted(){
    if (this.isMobile()) {
      console.log("移动端");
      // window.location.href = '';
    } else {
      console.log("PC端");
    }
  },
  methods: {
    isMobile() {
      let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
      return flag;
    }
  }
}
</script>
<style scoped>
#app .theme-picker {
  display: none;
}
</style>
